import { Component, OnInit } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import {map, Observable} from "rxjs";
import {Result} from "../../result";

@Component({
  selector: 'app-user-manager',
  templateUrl: './user-manager.component.html',
  styleUrls: ['./user-manager.component.css']
})
export class UserManagerComponent implements OnInit {
  constructor(private http: HttpClient) {
  }

  message$!: Observable<String>;

  ngOnInit(): void {

    this.message$ = this.http.get<Result>("api/demo/manager")
      .pipe(
        map(({message}) => message)
      )

  }

}
